.class public Lcom/bitauto/autoeasy/selectcar/Object/EvaluatParser;
.super Ljava/lang/Object;
.source "EvaluatParser.java"


# static fields
.field private static final AUTHOR:Ljava/lang/String; = "author"

.field private static final FACETITLE:Ljava/lang/String; = "facetitle"

.field private static final FILEPATH:Ljava/lang/String; = "filepath"

.field private static final FIRSTPICURL:Ljava/lang/String; = "firstPicUrl"

.field private static final MODIFYTIME:Ljava/lang/String; = "modifytime"

.field private static final NEWSID:Ljava/lang/String; = "newsid"

.field private static final SOURCENAME:Ljava/lang/String; = "sourceName"

.field private static final TAG:Ljava/lang/String; = "EvaluatParser"

.field private static final TITLE:Ljava/lang/String; = "title"


# instance fields
.field private url:Ljava/lang/String;


# direct methods
.method public constructor <init>(Ljava/lang/String;)V
    .locals 1
    .parameter "url"

    .prologue
    .line 34
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 31
    const-string v0, ""

    iput-object v0, p0, Lcom/bitauto/autoeasy/selectcar/Object/EvaluatParser;->url:Ljava/lang/String;

    .line 35
    iput-object p1, p0, Lcom/bitauto/autoeasy/selectcar/Object/EvaluatParser;->url:Ljava/lang/String;

    .line 36
    return-void
.end method


# virtual methods
.method public Paser2Object()Ljava/util/ArrayList;
    .locals 12
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/bitauto/autoeasy/selectcar/Object/Evaluat;",
            ">;"
        }
    .end annotation

    .prologue
    const/4 v9, 0x0

    const-string v11, "error :"

    const-string v10, "EvaluatParser"

    .line 41
    :try_start_0
    iget-object v7, p0, Lcom/bitauto/autoeasy/selectcar/Object/EvaluatParser;->url:Ljava/lang/String;

    invoke-static {v7}, Lcom/bitauto/autoeasy/tool/Caller;->doGet(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v6

    .line 42
    .local v6, str:Ljava/lang/String;
    if-eqz v6, :cond_1

    .line 43
    new-instance v4, Lorg/json/JSONObject;

    invoke-direct {v4, v6}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    .line 45
    .local v4, jObj:Lorg/json/JSONObject;
    new-instance v5, Ljava/util/ArrayList;

    invoke-direct {v5}, Ljava/util/ArrayList;-><init>()V

    .line 46
    .local v5, list:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Lcom/bitauto/autoeasy/selectcar/Object/Evaluat;>;"
    const-string v7, "NewDataSet"

    invoke-virtual {v4, v7}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v7

    const-string v8, "listNews"

    invoke-virtual {v7, v8}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v3

    .line 47
    .local v3, jArr:Lorg/json/JSONArray;
    invoke-virtual {v3}, Lorg/json/JSONArray;->length()I

    move-result v7

    if-lez v7, :cond_1

    .line 49
    const/4 v2, 0x0

    .local v2, i:I
    :goto_0
    invoke-virtual {v3}, Lorg/json/JSONArray;->length()I

    move-result v7

    if-lt v2, v7, :cond_0

    move-object v7, v5

    .line 63
    .end local v2           #i:I
    .end local v3           #jArr:Lorg/json/JSONArray;
    .end local v4           #jObj:Lorg/json/JSONObject;
    .end local v5           #list:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Lcom/bitauto/autoeasy/selectcar/Object/Evaluat;>;"
    .end local v6           #str:Ljava/lang/String;
    :goto_1
    return-object v7

    .line 50
    .restart local v2       #i:I
    .restart local v3       #jArr:Lorg/json/JSONArray;
    .restart local v4       #jObj:Lorg/json/JSONObject;
    .restart local v5       #list:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Lcom/bitauto/autoeasy/selectcar/Object/Evaluat;>;"
    .restart local v6       #str:Ljava/lang/String;
    :cond_0
    invoke-virtual {v3, v2}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v7

    invoke-virtual {p0, v7}, Lcom/bitauto/autoeasy/selectcar/Object/EvaluatParser;->createEvaluat(Lorg/json/JSONObject;)Lcom/bitauto/autoeasy/selectcar/Object/Evaluat;

    move-result-object v1

    .line 51
    .local v1, eva:Lcom/bitauto/autoeasy/selectcar/Object/Evaluat;
    invoke-virtual {v5, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Lcom/bitauto/autoeasy/tool/WSError; {:try_start_0 .. :try_end_0} :catch_1

    .line 49
    add-int/lit8 v2, v2, 0x1

    goto :goto_0

    .end local v1           #eva:Lcom/bitauto/autoeasy/selectcar/Object/Evaluat;
    .end local v2           #i:I
    .end local v3           #jArr:Lorg/json/JSONArray;
    .end local v4           #jObj:Lorg/json/JSONObject;
    .end local v5           #list:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Lcom/bitauto/autoeasy/selectcar/Object/Evaluat;>;"
    :cond_1
    move-object v7, v9

    .line 57
    goto :goto_1

    .line 58
    .end local v6           #str:Ljava/lang/String;
    :catch_0
    move-exception v7

    move-object v0, v7

    .line 59
    .local v0, e:Lorg/json/JSONException;
    const-string v7, "EvaluatParser"

    new-instance v7, Ljava/lang/StringBuilder;

    const-string v8, "error :"

    invoke-direct {v7, v11}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0}, Lorg/json/JSONException;->toString()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v7

    invoke-static {v10, v7}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    move-object v7, v9

    .line 60
    goto :goto_1

    .line 61
    .end local v0           #e:Lorg/json/JSONException;
    :catch_1
    move-exception v7

    move-object v0, v7

    .line 62
    .local v0, e:Lcom/bitauto/autoeasy/tool/WSError;
    const-string v7, "EvaluatParser"

    new-instance v7, Ljava/lang/StringBuilder;

    const-string v8, "error :"

    invoke-direct {v7, v11}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0}, Lcom/bitauto/autoeasy/tool/WSError;->getMessage()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v7

    invoke-static {v10, v7}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    move-object v7, v9

    .line 63
    goto :goto_1
.end method

.method public createEvaluat(Lorg/json/JSONObject;)Lcom/bitauto/autoeasy/selectcar/Object/Evaluat;
    .locals 5
    .parameter "obj"

    .prologue
    .line 73
    new-instance v1, Lcom/bitauto/autoeasy/selectcar/Object/Evaluat;

    invoke-direct {v1}, Lcom/bitauto/autoeasy/selectcar/Object/Evaluat;-><init>()V

    .line 75
    .local v1, evaluat:Lcom/bitauto/autoeasy/selectcar/Object/Evaluat;
    :try_start_0
    const-string v2, "author"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/bitauto/autoeasy/selectcar/Object/Evaluat;->setAuthor(Ljava/lang/String;)V

    .line 76
    const-string v2, "facetitle"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/bitauto/autoeasy/selectcar/Object/Evaluat;->setFacetitle(Ljava/lang/String;)V

    .line 77
    const-string v2, "filepath"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/bitauto/autoeasy/selectcar/Object/Evaluat;->setFilepath(Ljava/lang/String;)V

    .line 78
    const-string v2, "title"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/bitauto/autoeasy/selectcar/Object/Evaluat;->setTitle(Ljava/lang/String;)V

    .line 79
    const-string v2, "firstPicUrl"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/bitauto/autoeasy/selectcar/Object/Evaluat;->setFirstPicUrl(Ljava/lang/String;)V

    .line 80
    const-string v2, "modifytime"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/bitauto/autoeasy/selectcar/Object/Evaluat;->setModifytime(Ljava/lang/String;)V

    .line 81
    const-string v2, "sourceName"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/bitauto/autoeasy/selectcar/Object/Evaluat;->setSourceName(Ljava/lang/String;)V

    .line 82
    const-string v2, "newsid"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/bitauto/autoeasy/selectcar/Object/Evaluat;->setNewsid(Ljava/lang/String;)V
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    move-object v2, v1

    .line 87
    :goto_0
    return-object v2

    .line 84
    :catch_0
    move-exception v2

    move-object v0, v2

    .line 85
    .local v0, e:Lorg/json/JSONException;
    const-string v2, "EvaluatParser"

    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "error :"

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0}, Lorg/json/JSONException;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 86
    invoke-virtual {v0}, Lorg/json/JSONException;->printStackTrace()V

    .line 87
    const/4 v2, 0x0

    goto :goto_0
.end method
